{include file="header.html"}
<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
	$('#pay_time_from').datepicker({dateFormat: 'yy-mm-dd'});
    $('#pay_time_to').datepicker({dateFormat: 'yy-mm-dd'});
    $('#output_btn').bind('click',function(){
        if($('#pay_time_from').val() == '' || $('#pay_time_to').val() == '')
        {
            alert("请选择支付时间!")
            return false;
        }
        var $hidden_input=$('<input type="hidden" id="out_hid_input" name="isexport" value="1" />');
        $('#output_form').prepend($hidden_input).submit();
        $('#out_hid_input').remove();
    });
});
</script>
<div id="rightTop">
    <p>{$lang.order_manage}</p>
    <ul class="subnav">
        <li><span>{$lang.manage}</span></li>
        <li><a  href="javascript:;" class="btn1" id="output_btn" >导出</a></li>
    </ul>
</div>
<div class="mrightTop">
    <div class="fontl">
        <form method="get" id="output_form">
             <div class="left">
                <input type="hidden" name="app" value="order" />
                <input type="hidden" name="act" value="index" />
                <select class="querySelect" name="field">{html_options options=$search_options selected=$smarty.get.field}
                </select>:<input class="queryInput" type="text" name="search_name" value="{$query.search_name|escape}" />
                <select class="querySelect" name="status">
                    <option value="">{$lang.search_status}</option>
                    {html_options options=$order_status_list selected=$query.status}
                </select>
                {$lang.add_time_from}:<input class="queryInput pick_date" type="text" value="{$query.add_time_from}" id="add_time_from" name="add_time_from"  />
                {$lang.add_time_to}:<input class="queryInput pick_date" type="text" value="{$query.add_time_to}" id="add_time_to" name="add_time_to" />
                支付时间从:<input class="queryInput pick_date" type="text" value="{$query.pay_time_from}" id="pay_time_from" name="pay_time_from"  />
                至:<input class="queryInput pick_date" type="text" value="{$query.pay_time_to}" id="pay_time_to" name="pay_time_to" />
                {$lang.order_amount_from}:<input class="queryInput2" type="text" value="{$query.order_amount_from}" name="order_amount_from" />
                {$lang.order_amount_to}:<input class="queryInput2 pick_date" type="text" style="width:60px;" value="{$query.order_amount_to}" name="order_amount_to"  />
                <input type="submit" class="formbtn" value="{$lang.query}" />
            </div>
            <!--{if $filtered}-->
            <a class="left formbtn1" href="index.php?app=order">{$lang.cancel_query}</a>
            <!--{/if}-->
        </form>
    </div>
    <div class="fontr">
        {if $orders}{include file=page.top.html}{/if}
    </div>
</div>
<div class="tdare">
    <table width="100%" cellspacing="0" class="dataTable">
        <!--{if $orders}-->
        <tr class="tatr1">
            <td width="15%" class="firstCell"><span ectype="order_by" fieldname="seller_id">{$lang.store_name}</span></td>
            <td width="5%"><span ectype="order_by" fieldname="order_sn">{$lang.order_sn}</span></td>
            <td width="10%"><span ectype="order_by" fieldname="add_time">{$lang.add_time}</span></td>
             <td width="10%"><span ectype="order_by" fieldname="pay_time">支付时间</span></td>
            <td width="10%"><span ectype="order_by" fieldname="buyer_name">{$lang.buyer_name}</span></td>
            <td width="12%">
                <span ectype="order_by" fieldname="order_amount">{$lang.order_amount}</span>
                <p style="font-size: 10px;">(商品交易金额+运费–免邮–优惠金额)</p>
            </td>
            <td width="5%"><span ectype="order_by" fieldname="payment_code">{$lang.payment_name}</span></td>
            <td width="10%"><span ectype="order_by" fieldname="out_trade_sn">{$lang.out_trade_sn}</span></td>
            <td width="5%"><span ectype="order_by" fieldname="status">{$lang.status}</span></td>
            <td width="10%">{$lang.handler}</td>
        </tr>
        <!--{/if}-->
        <!--{foreach from=$orders item=order}-->
        <tr class="tatr2">
            <td class="firstCell">{$order.seller_name|escape}</td>
            <td>{$order.order_sn}&nbsp;&nbsp;<!--{if $order.extension eq 'groupbuy'}-->[{$lang.groupbuy}]<!--{/if}--></td>
            <td>{$order.add_time|date:complete}</td>
            <td><!--{if $order.pay_time gt 0}-->{$order.pay_time|date:complete}<!--{/if}--></td>
            <td>{$order.buyer_name|escape}</td>
            <td>{$order.order_amount|price}</td>
            <td>{$order.payment_name|escape|default:-}</td>
            <td>{$order.out_trade_sn}</td>
            <td>{$order.status|modifier:order_status} <!--{if $order.returns}--><a href="{url app=returns&field=order_sn&search_name=$order.order_sn}">查看退货退款</a><!--{/if}--></td>
            <td>
                <a href="index.php?app=order&amp;act=view&amp;id={$order.order_id}">{$lang.view}</a>
                <!--{if $order.status eq 20}--> | <a href="index.php?app=order&amp;act=add_track&amp;id={$order.order_id}">订单跟进</a><!--{/if}-->
            </td>
        </tr>
        <!--{foreachelse}-->
        <tr class="no_data">
            <td colspan="7">{$lang.no_data}</td>
        </tr>
        <!--{/foreach}-->
    </table>
    <div id="dataFuncs">
        <div class="pageLinks">
            {if $orders}{include file=page.bottom.html}{/if}
        </div>
    </div>
    <div class="clear"></div>
</div>
{include file="footer.html"}
